#!/usr/bin/env python
# -*- coding:utf-8 -*-
# import redis
import requests
from bs4 import BeautifulSoup
import time
import json

try:
    session = requests.session()
    # host = 'http://result.eolinker.com/wYP6JLz90f26fac05e677d66cf8a93dd0771d41f4c8d8ca?uri=test?t=111'
    host = 'http://result.eolinker.com/wYP6JLz90f26fac05e677d66cf8a93dd0771d41f4c8d8ca?uri=api/user/reg'
    data2 = {
        "name": "xxx"
    }
    resp = session.post(host,data=data2)
    print resp.text

    # host = 'https://www.1399p.com'
    # url = host + '/pk10/gyhomit?page=1&ball=0&type=0&sort=gyh&order=desc&_=' + str(time.time())
    # url2 = host + '/pk10/getawarddata?r=' + str(time.time())
    # resp2 = session.get(url2)
    # dicts = json.loads(resp2.text)
    # period = dicts['current']['period']
    # if period is not None and period != 'null':
    #     pass
    # # r = redis.Redis(host='127.0.0.1', port=6379,db=0,password='FJYCsfdsfw2334234$#%#@%$#^#$$^#')
    # # r.set('pk10_curinfo', resp2.text)
    #
    # resp = session.get(url)
    # soup = BeautifulSoup(resp.text, 'html.parser')
    # trs = soup.find_all('tr', attrs={'class': {"", "bg_gray"}})
    # for tr in trs:
    #     tds = tr.find_all(name='td')
    #     hstr = '和值=' + str(tds[0].string) + ',遗漏=' + str(tds[2].string.strip())
    #     maxval = str(tds[6].string.strip())
    #     desnum = 'pk10_num_' + str(tds[0].string)
    #     maxnum = 'pk10_maxnum_' + str(tds[0].string)
    #     # r.set(desnum,hstr)
    #     # r.set(maxnum,maxval)
except Exception as e:
    print str(e.message)
